package com.factory.demo2.abs;

import com.factory.demo2.ext.CheesePizza;
import com.factory.demo2.ext.ClamPizza;
import com.factory.demo2.ext.VeggiePizza;
import com.factory.demo2.face.PizzaIngredientFactory;
import com.factory.demo2.impl.ChicagoPizzaIngredientFactory;

public class ChicagoPizzaStore extends PizzaStore {

	protected Pizza createPizza(String item) {
		Pizza pizza = null;
		PizzaIngredientFactory ingredientFactory = new ChicagoPizzaIngredientFactory();

		if (item.equals("cheese")) {

			pizza = new CheesePizza(ingredientFactory);
			pizza.setName("Chicago Style Cheese Pizza");

		} else if (item.equals("veggie")) {

			pizza = new VeggiePizza(ingredientFactory);
			pizza.setName("Chicago Style Veggie Pizza");

		} else if (item.equals("clam")) {

			pizza = new ClamPizza(ingredientFactory);
			pizza.setName("Chicago Style Clam Pizza");

		}
		return pizza;
	}
}
